package com.lb.phonetest.controller;

import com.lb.phonetest.common.Result;
import com.lb.phonetest.service.PhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class PhoneController {

    @Autowired
    private PhoneService phoneService;

    @GetMapping("/phone")
    public Result getPhoneLocation(@RequestParam String phone) {
        Result phoneLocation = phoneService.getPhoneLocation(phone);
     return phoneLocation;}
}